﻿using JX.Infrastructure.LoadBalancer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace JX.Infrastructure.Consul
{
    /// <summary>
    /// 接口 consul服务构造器
    /// </summary>
    public interface IConsulServiceBuilder
    {
        /// <summary>
        /// 服务提供者
        /// </summary>
        IConsulServiceProvider ConsulServiceProvider { get; set; }

        /// <summary>
        /// 服务名称
        /// </summary>
        string ServiceName { get; set; }

        /// <summary>
        /// Uri方案  http / https
        /// </summary>
        string UriScheme { get; set; }

        /// <summary>
        /// 负载均衡策略
        /// </summary>
        ILoadBalancer LoadBalancer { get; set; }

        /// <summary>
        /// 构建服务地址方法，异步的，path是接口地址
        /// </summary>
        /// <param name="path">服务中的接口地址。例：/health </param>
        /// <returns></returns>
        Task<Uri> BuildAsync(string path);
    }
}
